//
//  ZBMoBanSixFirstCell.m
//  MoBan
//
//  Created by apple on 16/7/13.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ZBMoBanSixFirstCell.h"
@interface ZBMoBanSixFirstCell()
@property(nonatomic,strong)UILabel *NLable;
@property(nonatomic,strong)UILabel *Olable;
@property(nonatomic,strong)UIButton *butten;

@property(nonatomic,strong)UIImageView *imageview;

@end
@implementation ZBMoBanSixFirstCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self =[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self AddUI];
    }
    return self;

}
-(void)AddUI
{

    self.imageview = [[UIImageView alloc]init];
    self.imageview.image = [UIImage imageNamed:@"text.png"];
    [self.contentView addSubview:self.imageview];
    
    self.NLable = [[UILabel alloc]init];
    self.NLable.text =@"28";
    [self.contentView addSubview:self.NLable];
    
    self.Olable = [[UILabel alloc]init];
    self.Olable.text =@"18";
    [self.contentView addSubview:self.Olable];
    
    self.butten = [[UIButton alloc]init];
    self.butten.backgroundColor = [UIColor greenColor];
    [self.butten setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.butten addTarget:self action:@selector(btnclic) forControlEvents:UIControlEventTouchUpInside];
    [self.butten setTitle:@"立即购买" forState:UIControlStateNormal];
    
    [self.contentView addSubview:self.butten];
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imageview.frame = CGRectMake(0, 0, KscrW, 150*Kscr);
    
    self.NLable.frame = CGRectMake(10*Kscr, 165*Kscr, 50*Kscr, 20*Kscr);
    
    self.Olable.frame = CGRectMake(self.NLable.right+10*Kscr, 165*Kscr, 50*Kscr, 20*Kscr);
    
    self.butten.frame = CGRectMake(KscrW-120*Kscr, 155*Kscr, 100*Kscr, 40*Kscr);


}
-(void)btnclic
{
    if ([self.deleget respondsToSelector:@selector(ZBBuyBtnClic)]) {
        [self.deleget ZBBuyBtnClic];
    }
    
}
@end
